package com.caine.tc;

import com.caine.tc.server.NettyServer;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

import java.util.concurrent.CountDownLatch;

@SpringBootApplication
public class TcApplication implements CommandLineRunner {

    public static void main(String[] args) throws InterruptedException {
        CountDownLatch countDownLatch = new CountDownLatch(1);
        SpringApplication.run(TcApplication.class, args);
        countDownLatch.await();
    }

    @Override
    public void run(String... args) throws Exception {
        new Thread(()->new NettyServer(20001).start()).start();
    }
}
